package com.moneytalks.blaze.poc.service.beans;

import java.util.List;

import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;

import com.moneytalks.blaze.poc.domain.ExecutiveOfficer;
import com.moneytalks.blaze.poc.service.ExecutiveOfficerService;

public class ExecutiveOfficerServiceBean implements ExecutiveOfficerService {

	@Autowired
	private SessionFactory sessionFactory;

	public void addExecutiveOfficer(ExecutiveOfficer executiveOfficer) {
		sessionFactory.getCurrentSession().save(executiveOfficer);
	}

	@SuppressWarnings("unchecked")
	public List<ExecutiveOfficer> listExecutiveOfficers() {
		return sessionFactory.getCurrentSession().createCriteria(ExecutiveOfficer.class).list();
	}
}
